<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
<script>

/*var a = [1,2,3];
var b = [1,2,3];

alert( a == b );  //false*/

//var a = 5;
//var b = a;
//b += 3;
////alert(b); //8
//alert(a); //5   基本类型 : 赋值的时候只是值的复制


//var a = [1,2,3];
//var b = a;
//b.push(4);
////alert(b);  //[1,2,3,4]
//alert(a);  //[1,2,3,4]   对象类型 : 赋值不仅是值的复制，而且也是引用的传递

//var a = [1,2,3];
//var b = a;
//b = [1,2,3,4];
////alert(b); //[1,2,3,4]
//alert(a); //[1,2,3]

//var a = 5;
//var b = 5;
//
//alert(a == b);  //基本类型 : 值相同就可以


//var a = [1,2,3];
//var b = [1,2,3];

//alert( a == b );  //false  //对象类型 : 值和引用都相同才行

var a = [1,2,3];
var b = a;
alert( a==b );  //true

</script>
</head>

<body>
</body>
</html>
